package com.upup.train_management.repository;

import com.upup.train_management.entity.RouteStation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RouteStationRepository extends JpaRepository<RouteStation, Long> {
    List<RouteStation> findByRouteIdOrderByStationOrder(Long routeId);

    RouteStation findByRouteIdAndStationId(Long routeId, Long stationId);

    void deleteByRouteId(Long routeId);

    void deleteByRouteIdAndStationId(Long routeId, Long stationId);
}